﻿using Library.Core.Domain.Repository;
using Synthesize.BaseSet.Domain.Aggregation.Dtos.Authority.Menu;
using Synthesize.BaseSet.Domain.Aggregation.Entity.Authority;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;

namespace Synthesize.BaseSet.Domain.Repository.Authority
{

    public interface IMenuRepository : IRepository<MenuInfoEntity>
    {
        /// <summary>
        /// 根据条件获取菜单信息
        /// </summary>
        /// <param name="specification"></param>
        /// <param name="readOnly"></param>
        /// <returns></returns>
        Task<List<GetMenuDetailListOutDto>> GetMenuList(Expression<Func<MenuInfoEntity, bool>> specification, bool readOnly);

        /// <summary>
        /// 根据平台获取菜单信息【角色Id条件，作用于left join】
        /// </summary>
        /// <param name="input"></param>
        /// <param name="readOnly"></param>
        /// <returns></returns>
        Task<List<GetMenuTreeByPlatformOutDto>> GetMenuListByPlatform(GetMenuListByPlatformInDto input, bool readOnly);

        /// <summary>
        /// 根据角色获取菜单信息
        /// </summary>
        /// <param name="input"></param>
        /// <param name="readOnly"></param>
        /// <returns></returns>
        Task<List<MenuInfoEntity>> GetMenuListByRole(GetMenuListByRoleInDto input, bool readOnly);

        /// <summary>
        /// 获取角色对应可操作权限信息
        /// </summary>
        /// <param name="input"></param>
        /// <param name="readOnly"></param>
        /// <returns></returns>
        Task<List<GetRoleMenuPermissionOutDto>> GetMenuPermissionListByRole(GetMenuPermissionListByRoleInDto input, bool readOnly);
    }
}
